package com.jltx.zeus.arch.api

import com.google.gson.Gson
import com.google.gson.GsonBuilder
import retrofit2.converter.gson.GsonConverterFactory

/**
 * @author aidenquan
 *         Created by junlintianxia on 2020/10/09.
 */
object GsonFactoryUtils {
    fun providerGson(): Gson {
        return GsonBuilder().excludeFieldsWithoutExposeAnnotation()
            .create() //对不带@Expose注解的属性进行序列化和反系列化
    }


    fun providerGsonConverterFactory(): GsonConverterFactory? {
        val gson = providerGson()
        return GsonConverterFactory.create(gson)
    }
}